Use actual drop status
authorMatthias Clasen <mclasen@redhat.com>
Tue, 19 Jan 2016 12:13:57 +0000 (07:13 -0500)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Jan 2016 13:17:36 +0000 (14:17 +0100)
We have this information in the XDND protocol, so we don't have
to blindly assume that the drop succeeded.

gdk/x11/gdkdnd-x11.c

index b8468d3ab063d34d9d4111d5dbc617e216ae7749..56f3372fdd312ed4955d45ab3eb0f9ed130dc90f 100644 (file)
@@ -3080,11 +3080,13 @@ static gboolean
 gdk_dnd_handle_drop_finished (GdkDragContext *context,
                               const GdkEventDND *event)
 {
+  GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context);
+
   if (context != event->context)
     return FALSE;
 
   g_signal_emit_by_name (context, "dnd-finished");
-  gdk_drag_drop_done (context, TRUE);
+  gdk_drag_drop_done (context, !x11_context->drop_failed);
   return TRUE;
 }